package phase01module02.homework;

//编写普通通话类实现通话类，该类继承了抽象类并实现通话接口
public class TeleClass extends Abstract implements TeleInterface {
    private int message;

    Bill bill = new Bill();

    /**
     * expense  资费
     * quantity 赠送通话时间
     * message  赠送短信
     */
    public TeleClass() {
    }

    public TeleClass(int expense, int quantity, int message) {
        super(expense, quantity);
        this.message = message;
    }

    public int getMessage() {
        return message;
    }

    public void setMessage(int message) {
        this.message = message;
    }

    //重写通话接口,打印继承下来的抽象成员expense quantity  message
    @Override
    public void show() {
        System.out.println("通话套餐:国内语音" + getExpense() + "元/分钟，赠送" + getQuantity() + "分钟国内语音，赠送国内短彩信" + getMessage() + "条，包含国内接听来电显示");
    }

    @Override
    public void telePackage(int teleTime, PhoneCard phoneCard) {
        if(0 == getQuantity()){
            setQuantity(1);
        }
        bill.countTeleTime(teleTime, getQuantity(), phoneCard);

    }
}
